import { computed } from 'vue';
import { STEP } from '@/constants/index';

export type PositionType = {
  x: number;
  y: number;
};

export function usePosition(pos: PositionType) {
  const position = computed(() => ({
    left: STEP * pos.x + 'px',
    top: STEP * pos.y + 'px',
  }));

  return { position };
}
